<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/11
 * Time: 15:49
 */

namespace app\admin\model;



use traits\model\SoftDelete;

class ServiceCategory extends Base
{
    use SoftDelete;

    protected $autoWriteTimestamp = 'datetime';

    public function getStatusAttr($value)
    {
        $status = [1=>'应用',2=>'禁用'];
        return $status[$value];
    }

    public function serviceDetails()
    {
        return $this->hasMany("service_details",'category','id');
    }
}